#ifndef MAGIC_TOWER_H
#define MAGIC_TOWER_H

#include <QMainWindow>
#include <QString>
#include "monster.h"
#include <QKeyEvent>
#include <QTimer>
namespace Ui {
class magic_tower;
}
class magic_tower : public QMainWindow
{
    Q_OBJECT
public slots:
    //void update();
public:
    explicit magic_tower(QWidget *parent = 0);
    ~magic_tower();
    void InitBraver();//初始化勇士
    void paintEvent(QPaintEvent *event);
    void keyPressEvent(QKeyEvent *event);
    QKeyEvent *Key;
    void InitMap();
    void showthings();
    int posy;
    int posx;
    int direction=1;
    bool IsRun=0;
    int level;//等级
    int hp;//生命
    int atk;//攻击
    int pdef;//防御
    int exp;//经验
    int gold;//金币
    int floor;
    int key1;
    int key2;
    int key3;
    QRect pos;
private:
    Ui::magic_tower *ui;
};
struct Monster
{
public:
    int hp;//生命
    int atk;//攻击
    int pdef;//防御
    int exp;//经验
    int gold;//金币
    QString name;//名称
};
struct Place
{
    QRect rect;
    int cover;//0平地，1墙
};
#endif // MAGIC_TOWER_H
